# -*- coding:utf-8 -*-
import os
import pathlib
import time
from win10toast import ToastNotifier

ABSPATH = pathlib.Path(__file__).resolve().parent.parent


def sendMacMsg(string):
    try:
        os.system(f"osascript -e 'display notification {string}")
        # os.system('''/usr/bin/osascript -e 'display notification with title \"123455)\"' ''')
        time.sleep(3)
    except Exception:
        pass


toast = ToastNotifier()


def sendWinMsg(title, msg):
    toast.show_toast(title=title, msg=msg, icon_path=os.path.join(ABSPATH, "icon", "system.ico"),
                     duration=5, threaded=True)
